3.40 \(\int \csc ^2(e+f x) (a+b \tan ^2(e+f x)) \, dx\)

Optimal. Leaf size=24 \[ \frac{b \tan (e+f x)}{f}-\frac{a \cot (e+f x)}{f} \]

[Out]

-((a*Cot[e + f*x])/f) + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Rubi [A]  time = 0.0322951, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 21, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.095, Rules used = {3663, 14} \[ \frac{b \tan (e+f x)}{f}-\frac{a \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Int[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Cot[e + f*x])/f) + (b*Tan[e + f*x])/f

Rule 3663

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff^(m + 1))/f, Subst[Int[(x^m*(a + b*(ff*x)^n)^p)/(c^2 + ff^2*x^2
)^(m/2 + 1), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2]

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

\begin{align*} \int \csc ^2(e+f x) \left (a+b \tan ^2(e+f x)\right ) \, dx &=\frac{\operatorname{Subst}\left (\int \frac{a+b x^2}{x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (b+\frac{a}{x^2}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac{a \cot (e+f x)}{f}+\frac{b \tan (e+f x)}{f}\\ \end{align*}

Mathematica [A]  time = 0.0207985, size = 24, normalized size = 1. \[ \frac{b \tan (e+f x)}{f}-\frac{a \cot (e+f x)}{f} \]

Antiderivative was successfully verified.

[In]

Integrate[Csc[e + f*x]^2*(a + b*Tan[e + f*x]^2),x]

[Out]

-((a*Cot[e + f*x])/f) + (b*Tan[e + f*x])/f

________________________________________________________________________________________

Maple [A]  time = 0.078, size = 23, normalized size = 1. \begin{align*}{\frac{b\tan \left ( fx+e \right ) -\cot \left ( fx+e \right ) a}{f}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x)

[Out]

1/f*(b*tan(f*x+e)-cot(f*x+e)*a)

________________________________________________________________________________________

Maxima [A]  time = 1.0621, size = 32, normalized size = 1.33 \begin{align*} \frac{b \tan \left (f x + e\right ) - \frac{a}{\tan \left (f x + e\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

(b*tan(f*x + e) - a/tan(f*x + e))/f

________________________________________________________________________________________

Fricas [A]  time = 1.92869, size = 82, normalized size = 3.42 \begin{align*} -\frac{{\left (a + b\right )} \cos \left (f x + e\right )^{2} - b}{f \cos \left (f x + e\right ) \sin \left (f x + e\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-((a + b)*cos(f*x + e)^2 - b)/(f*cos(f*x + e)*sin(f*x + e))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (a + b \tan ^{2}{\left (e + f x \right )}\right ) \csc ^{2}{\left (e + f x \right )}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)**2*(a+b*tan(f*x+e)**2),x)

[Out]

Integral((a + b*tan(e + f*x)**2)*csc(e + f*x)**2, x)

________________________________________________________________________________________

Giac [A]  time = 1.56161, size = 35, normalized size = 1.46 \begin{align*} \frac{b \tan \left (f x + e\right ) - \frac{a}{\tan \left (f x + e\right )}}{f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(f*x+e)^2*(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

(b*tan(f*x + e) - a/tan(f*x + e))/f